package com.example.thread.mapper;


import com.example.thread.pojo.Demo;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestBody;

@Mapper
public interface TestMapper {

    @Insert("insert into demo values (#{test.id},#{test.name})")
    public void save(@Param("test") Demo test);

    @Select("select * from demo where id % 2 = #{param}")
    List<Demo> getByParam(@Param("param") Integer param);


    @Select("select * from demo")
    List<Demo> get();

}
